package com.ssn.jse.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class OracleJDBC {
	public static void main(String[] args) {
		try {
			Class.forName("oracle.jdbc.driver.OracleDriver");
			Connection ct=DriverManager.getConnection
							("jdbc:oracle:thin:@127.0.0.1:1521:first",
							"scott","ooo");
			Statement sm=ct.createStatement();
			ResultSet rs=sm.executeQuery("select * from emp");
			
			while(rs.next()){
				System.out.println("ename " + rs.getString(2));
			}
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
	}
}
